//
//  GroupsModel.m
//  News
//
//  Created by xalo on 16/3/9.
//  Copyright © 2016年 News. All rights reserved.
//

#import "GroupsModel.h"
#import "FMDatabase+Database.h"
#import "NewsModel.h"

@implementation GroupsModel

// 根据分区号初始化分组
- (instancetype)initWithIndex:(NSInteger)index {
    
    self = [super init];
    if (self) {
        
//        NSMutableArray *array = [NSMutableArray array];
        switch (index) {
            case 0:
                self.collection_category = @"video";
                self.title = @"视频";
                break;
            case 1:
                self.collection_category = @"hdpic";
                self.title = @"图片";
                break;
            case 2:
                self.collection_category = @"cms";
                self.title = @"新闻";
                break;
            default:
                self.collection_category = @"cms";
                self.title = @"新闻";
                break;
        }
//        NSArray *newsModelsArray = [[FMDatabase shareManager] selectNewsModelArrayByCategory:self.collection_category];
        
//        self.newsModelArray = [[FMDatabase shareManager] selectNewsModelArrayByCategory:self.collection_category];
//        self.collection_num = self.newsModelArray.count;
        
    }
    return self;
}



@end
